// 云函数入口文件
const cloud = require('wx-server-sdk')

cloud.init({
  traceUser: true,
  env:'aaa111-9gh9fp5ieac4de5d'
})

const db = cloud.database()

// 云函数入口函数
exports.main = async (event, context) => {
    try {
        return await db.collection('accrecord').add({
          data: {
              tripid:event.tripid,
              note: event.note,
              timeStamp: event.timeStamp,
              name: event.name,
              amount: event.amount,
              classifi: event.classifi
          }
        })
      } catch(e) {
        console.error(e)
      }
}